﻿using JKZP.Model;
using System;
using System.Collections.Generic;
using System.Data.OracleClient;
using System.Text;

namespace JKZP.DAL
{
    public class SendQueueDAL
    {
        public int Insert(SendQueue sendqueue)
        {
            int returnValue = 0;
            //to_date(:JGSJ,'yyyy-mm-dd hh24:mi:ss')
            //INSERT INTO SendQueue
     //       (Phonenum1, Vsource, sendtype, maxtimes, timing, Taskid, Vmode, Stimes, State, Priority)

     //VALUES
     //      ('18601504926', '[s4]你好啊', '0', '1', '0', '-1', '1', '0', '0', '2')
            returnValue = SqlHelper.ExecuteNonQuery(@"INSERT INTO SendQueue
                        (Phonenum1, Vsource, sendtype, maxtimes, timing, Taskid, Vmode, Stimes, State, Priority)
                 VALUES                       (:Phonenum1, :Vsource, :sendtype,:maxtimes,:timing,:Taskid, :Vmode, :Stimes,:State,:Priority)",

                new OracleParameter(":Phonenum1", sendqueue.Phonenum1),
                new OracleParameter(":Vsource", sendqueue.Vsource),
                new OracleParameter(":sendtype", sendqueue.Sendtype),
                new OracleParameter(":maxtimes", sendqueue.Maxtimes),
                new OracleParameter(":timing", sendqueue.Timing),
                new OracleParameter(":Taskid", sendqueue.Taskid),
                new OracleParameter(":Vmode", sendqueue.Vmode),
                new OracleParameter(":Stimes", sendqueue.Stimes),
                new OracleParameter(":State", sendqueue.State),
                new OracleParameter(":Priority", sendqueue.Priority));
            return returnValue;

        }
    }
}
